import Vue from 'vue';

import VueRouter from 'vue-router'

import Login from '../pages/Login'

import Home from '../pages/Home'

import News from '../pages/Home/News'

import Music from '../pages/Home/Music'

import Games from "../pages/Home/Games";

Vue.use(VueRouter)

export default new VueRouter({
  routes : [
    {path : '/login' , component: Login ,name: "login" },
    {path : '/home', component: Home,name: "home",
  children:[
    { path: "music/:id/:tiem?", component: Music, name: "music" },
    { path: "news", component: News, name: "news" },
    { path: "games", component: Games, name: "games" ,
    props: (route) =>{
      return {
        ...route.query, ...route.meta
      }
    },
    mwte :{
      hot: "我永远热爱看游戏",
      isIcon: true,
    }
  },
    { path: "", redirect: "/home/news" },
  ]},
      /* 通过路由规则的redirect属性，指定一个新的路由地址，可以很方便地设置路由的重定向 */
      { path: "/", redirect: "/home" },
  ]
})